#define dataTable(tabs,attrs,modelList,action)
<style>
.tablebox {
	position: relative;
}

.tablebox .loading {
	position: absolute;
	top: 134px;
	left: 0;
	right: 0;
	bottom: 55px;
	z-index: 11;
	text-align: center;
	background-color: rgba(255,255,255,.8);
}

.tablebox .loading img {
	width: 76px;
	margin-top: 30px;
}

</style>
<div id="table">
	<div id="toolbar" class="input-group">
    	<select id="stepsearch" class="form-control" style="border-radius: 4px;">
  			<option value="" selected="selected">按进度筛选</option>
  			<option value="2">待审核</option>
  			#if(action=='firstTrial')
  			<option value="3">已拒绝</option>
  			#else
  			<option value="3">有反馈</option>
  			#end
  			<option value="4">审核中</option>
  			<option value="5">已通过</option>
  			
		</select>
	</div>
	<div class="tablebox">
		<div class="loading" id="tableloading">
			<img src="/assets/img/big-loading.svg" />
			<p>正在加载...</p>
		</div>
		<table id="rtable" class="table table-hover" style="cursor: pointer;font-size: 12px;">
			
		</table>
	</div>
</div>
<script>
	$(function(){
		var $action = "#(action)",
			$table = $("#rtable"),
			loadingDom = $("#tableloading"),
			titles = [
			    {
					field: "ownerHtml",
					title: "-"
				},
				{
					field: "Operator",
					title: "运营商"
				},
				{
					field: "product",
					title: "产品"
				},
				{
					field: "date",
					title: "日期"
				},
				{
					field: "name",
					title: "姓名"
				},
				{
					field: "stepHtml",
					title: "进度"
				}
			]
			
		getDate("",function(){
			loadingDom.hide()
		})
		
		$table.bootstrapTable({
			height: 600,
			showColumns: true,
			search: true,
			toolbar: "#toolbar",
			showToggle: true,
			pagination: true, 
            pageSize: 15,
		    columns: titles,
		    //data: res.data,
		    sortStable:true,
		    rowAttributes: function(row,index){
		    	return {
		    		'data-orderid': row.order_id,
		    		'data-power': row.owner==2?false:true
		    	}
		    }
		});
		
		$("#stepsearch").change(function(){
			var val = $(this).val()
			loadingDom.fadeIn(300)
			getDate(val,function(){
				loadingDom.hide()
			})
		})
		
		function getDate(val,callback){
			var sendData = null
			if(!_x.isEmpty(val)){
				sendData = _x.qsStringify({step: val})
			}
			
			axios.post("/admin/searchRecordByStep",sendData)
			.then(function(res){
				for(var i = 0;i < res.data.length;i++){
					if(res.data[i].step == 2){
						res.data[i].stepHtml = "待审核"
					}else if(res.data[i].step == 3){
						res.data[i].stepHtml = "<span style='color: #d9534f;'>有反馈</span>"
							if($action === "firstTrial"){
								res.data[i].stepHtml = "<span style='color: #d9534f;'>已拒绝</span>"
							}
					}else if(res.data[i].step == 4){
						res.data[i].stepHtml = "<span style='color: #f0ad4e;'>审核中</span>"
					}else if(res.data[i].step == 5){
						res.data[i].stepHtml = "<span style='color: #5cb85c;'>已通过</span>"
					}
					if(res.data[i].owner == 1){
						res.data[i].ownerHtml = "<i class='iconfont' style='color: #09f;'>&#xe634;</i>"
					}else if(res.data[i].owner == 0){
						res.data[i].ownerHtml = "<i class='iconfont' style='color: #f55d12;'>&#xe616;</i>"
					}else{
						res.data[i].ownerHtml = ""
					}
				}
				$table.bootstrapTable('load', res.data)
				callback()
			})
		}
	})
</script>
#end